package com.lzc.jobrecomendbackend.controller.education;

import com.lzc.jobrecomendbackend.common.ApiResponse;
import com.lzc.jobrecomendbackend.model.education.EducationDistributionVO;
import com.lzc.jobrecomendbackend.service.education.EducationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 学历分析控制器
 */
@RestController
@RequestMapping("/api/education")
public class EducationController {

    @Autowired
    private EducationService educationService;
    
    /**
     * 获取学历要求分布
     * 
     * @param city 城市（可选）
     * @param companySize 公司规模（可选）
     * @return 学历要求分布数据
     */
    @GetMapping("/distribution")
    public ApiResponse<List<EducationDistributionVO>> getEducationDistribution(
            @RequestParam(required = false) String city,
            @RequestParam(required = false, name = "company_size") String companySize) {
        
        List<EducationDistributionVO> result = educationService.getEducationDistribution(city, companySize);
        return ApiResponse.success(result);
    }
} 